﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleWeb._Default"
    MasterPageFile="~/SiteMaster.Master" %>

<%@ Register Assembly="GenericDataSourceControl" Namespace="GenericDataSourceControl"
    TagPrefix="cc1" %>
    
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContent" runat="server">
    <cc1:GenericDataSource ID="GenericDataSource1" runat="server">
    </cc1:GenericDataSource>
    <asp:FormView ID="WelcomeView" runat="server" DataSourceID="GenericDataSource1" Font-Size="Larger" Font-Names="Verdana">
        <ItemTemplate>
            <h3>
                <asp:Label ID="MessageLabel" runat="server" Text='<%# Eval("Message") %>'></asp:Label>
            </h3>
            <p>
                <asp:Label ID="BodyLabel" runat="server" Text='<%# Eval("Body") %>'></asp:Label>
            </p>
            <p>The GenericDataSource is very simple to be used with any data bound control
                <ul>
                    <li>GridView</li>
                    <li>FormView</li>
                    <li>DetailsView</li>
                    <li>ListView</li>
                    <li>Repeater</li>
                    <li>DropDownList</li>
                    <li>BulletedList</li>
                    <li>RadioButtonList</li>
                    <li>CheckBoxList</li>
                    <li>ListBox</li>
                </ul>
                ...just as any other ASP.NET DataSource.
            </p>
            <p>Just add the GenericDataSource in your mark-up, setup the right DataSourceID for the data bound control and then implement the four data Event Handlers as needed:
                <ul>
                    <li>ExecuteSelect</li>
                    <li>ExecuteInsert</li>
                    <li>ExecuteUpdate</li>
                    <li>ExecuteDelete</li>
                </ul>
                ...and that's it: simple and straightforward.
            </p>
            <p>But there's more: the GenericDataSource may handle automatically the Sorting and Paging of your datasource and knows how to handle deffered execution of IQueryable&lt;T&gt; (LINQ to SQL and Entity Framework) data sources.</p>
            <p>Of course, it works perfectly with and without ASP.NET Ajax Update Panel.</p>
        </ItemTemplate>
    </asp:FormView>
</asp:Content>
